/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package DAO.MySQL;

import DAO.DAOSoftware;
import java.net.InetAddress;
import java.sql.CallableStatement;
import java.sql.Types;

/**
 * DAOSoftwareMySQL
 *
 * Versao 1.0
 *
 * Data 31/05/2014
 *
 * @author Igor
 */
public class DAOSoftwareMySQL extends DAOConexaoMySQL implements DAOSoftware {

    @Override
    public long autenticarVersao(String strVersao, String strSoftware) throws Exception {
        long vReturn = -1; //Representa que nao achou o profissional

        CallableStatement cs;
        cs = this.con.getCon().prepareCall("{ ? = call AUTENTICAR_VERSAO(?,?)}");

        cs.registerOutParameter(1, Types.NUMERIC);
        cs.setString(2, strVersao);
        cs.setString(3, strSoftware);
        cs.execute();

        vReturn = cs.getLong(1);
        this.con.getStm().executeBatch();

        return vReturn;
    }
    
}
